'use strict';

module.exports = function(Metadata) {

  var pattern = require('../pattern');

  Metadata.patterns = function (req, res) {
    res.json(pattern.allPatterns())
  };

  Metadata.rules = function (req, res) {
    res.json(['血流成河', '自摸加番', '带擦挂', '呼叫转移']);
  };

  Metadata.remoteMethod(
    'patterns', {
      http: { verb: 'get' },
      accepts: [
        { arg: 'data', type: 'object', http: { source: 'req' } },
        { arg: 'res', type: 'object', http: { source: 'res' } }
      ]
    }
  );

  Metadata.remoteMethod(
    'rules', {
      http: { verb: 'get' },
      accepts: [
        { arg: 'data', type: 'object', http: { source: 'req' } },
        { arg: 'res', type: 'object', http: { source: 'res' } }
      ]
    }
  );


};
